#include<iostream>
#include<unistd.h>
#include<sys/types.h>
#include<sys/stat.h>
#include<fcntl.h>
using namespace std;
int main()
{
    char buf[1024];
    int fd=open("fifo",O_RDONLY);
    while(true)
    {
        int n=read(fd,buf,sizeof(buf)-1);
        buf[n]='\0';
        cout<<"write say:"<<buf<<endl;
    }
    return 0;
}